﻿using System;
using System.ComponentModel;
using SenetExperimentsRunner.Utils.TypeDescriptors;

//using SenetExperimentsRunner.Utils.TypeDescriptors;

namespace SenetExperimentsRunner.Logic.Experiment
{
    [TypeDescriptionProvider(typeof(ExperimentTypeDescProv))]
    [Serializable]
    class Experiment : INotifyPropertyChanged, ICloneable
    {
        #region /// Changable variable enumeration ///
        public enum ChangableVarEnum
        {
            GP_PlayerTurnNumber,
            GP_SecondsPerTurn,
            GP_SticksNumber,
            GP_SquaresNumber,
            GP_InitialPlayerPieces,
            GP_AdditionalSafeSquares,
            GP_AdditionalRebirthSquares,
            GP_Heuristics_P1_Param1,
            GP_RequiredDepth,
            Heur_P1_Param2,
            Heur_P2_Param1,
            Heur_P2_Param2,
        }

        #endregion

        #region /// Private Members ///

        private ExperimentParams m_ExperimentParams = new ExperimentParams();
        private ExperimentResult m_ExperimentResults = new ExperimentResult();

        #endregion

        #region /// Public Properties ///

        public ExperimentParams ExperimentParams
        {
            get { return m_ExperimentParams; }
            set
            {
                m_ExperimentParams = value;
             //   this.NotifyPropertyChanged("TypeIcon");
            }
        }

        public ExperimentResult ExperimentResults
        {
            get { return m_ExperimentResults; }
            set
            {
                m_ExperimentResults = value;
                NotifyPropertyChanged("ExperimentResult");
            }
        }

        #endregion

        #region /// Implementation of INotifyPropertyChanged ///

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region /// Private Methods ///
        private void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }
        }
        #endregion

        #region /// Implementation of ICloneable ///

        public object Clone()
        {
            Experiment clonedExperiment = Logic.Cloner.SerialrClone.Clone(this); ;
            clonedExperiment.ExperimentParams.ExperimentId = ExperimentParams.GetNextExperimentID();
            return clonedExperiment;
        }

        #endregion
    }
}